package Test;

import java.util.Arrays;
import java.util.Scanner;

public class Delet {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int[] socres = new int[7];
        socres[0] = 90;
        socres[1] = 60;
        socres[2] = 70;
        System.out.println("输入要删除的数字");
        int num = input.nextInt();
        int index = - 1;
        for ( int i = 0; i < socres.length; i++ ) {
            if (socres[i] == num) {
                index = i;
                break;
            }
        }
        if (index == - 1) {
            System.out.println("没有找到相应的数据，删除失败");
        } else {

            for ( int k = index; k < socres.length - 1; k++ ) {

                socres[k] = socres[k + 1];

            }
            socres[socres.length - 1] = 0;
            System.out.println("删除成功");


        }


            System.out.println(Arrays.toString(socres));
    }
}
